/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Felipe Duarte
 */
@Entity
@Table(name = "construccion_material_construccion")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ConstruccionMaterialConstruccion.findAll", query = "SELECT c FROM ConstruccionMaterialConstruccion c"),
    @NamedQuery(name = "ConstruccionMaterialConstruccion.findByIdConstruccionMaterialConstruccion", query = "SELECT c FROM ConstruccionMaterialConstruccion c WHERE c.idConstruccionMaterialConstruccion = :idConstruccionMaterialConstruccion")})
public class ConstruccionMaterialConstruccion implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID_CONSTRUCCION_MATERIAL_CONSTRUCCION")
    private Integer idConstruccionMaterialConstruccion;
    @Column(name = "CANTIDAD_MATERIAL_ASIGNADA_CONSTRUCCION")
    private Integer cantidadMaterialAsignadaConstruccion;
    @JoinColumn(name = "ID_MATERIAL_CONSTRUCCION_CONSTRUCCION_MATERIAL_CONSTRUCCION", referencedColumnName = "ID_MATERIAL_CONSTRUCCION")
    @ManyToOne(optional = false)
    private MaterialConstruccion idMaterialConstruccionConstruccionMaterialConstruccion;
    @JoinColumn(name = "ID_CONSTRUCCION_CONSTRUCCION_MATERIAL_CONSTRUCCION", referencedColumnName = "ID_CONSTRUCCION")
    @ManyToOne(optional = false)
    private Construccion idConstruccionConstruccionMaterialConstruccion;

    public ConstruccionMaterialConstruccion() {
    }

    public ConstruccionMaterialConstruccion(Integer idConstruccionMaterialConstruccion) {
        this.idConstruccionMaterialConstruccion = idConstruccionMaterialConstruccion;
    }

    public Integer getIdConstruccionMaterialConstruccion() {
        return idConstruccionMaterialConstruccion;
    }

    public void setIdConstruccionMaterialConstruccion(Integer idConstruccionMaterialConstruccion) {
        this.idConstruccionMaterialConstruccion = idConstruccionMaterialConstruccion;
    }

    public MaterialConstruccion getIdMaterialConstruccionConstruccionMaterialConstruccion() {
        return idMaterialConstruccionConstruccionMaterialConstruccion;
    }

    public void setIdMaterialConstruccionConstruccionMaterialConstruccion(MaterialConstruccion idMaterialConstruccionConstruccionMaterialConstruccion) {
        this.idMaterialConstruccionConstruccionMaterialConstruccion = idMaterialConstruccionConstruccionMaterialConstruccion;
    }

    public Construccion getIdConstruccionConstruccionMaterialConstruccion() {
        return idConstruccionConstruccionMaterialConstruccion;
    }

    public Integer getCantidadMaterialAsignadaConstruccion() {
        return cantidadMaterialAsignadaConstruccion;
    }

    public void setCantidadMaterialAsignadaConstruccion(Integer cantidadMaterialAsignadaConstruccion) {
        this.cantidadMaterialAsignadaConstruccion = cantidadMaterialAsignadaConstruccion;
    }
    

    public void setIdConstruccionConstruccionMaterialConstruccion(Construccion idConstruccionConstruccionMaterialConstruccion) {
        this.idConstruccionConstruccionMaterialConstruccion = idConstruccionConstruccionMaterialConstruccion;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idConstruccionMaterialConstruccion != null ? idConstruccionMaterialConstruccion.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ConstruccionMaterialConstruccion)) {
            return false;
        }
        ConstruccionMaterialConstruccion other = (ConstruccionMaterialConstruccion) object;
        if ((this.idConstruccionMaterialConstruccion == null && other.idConstruccionMaterialConstruccion != null) || (this.idConstruccionMaterialConstruccion != null && !this.idConstruccionMaterialConstruccion.equals(other.idConstruccionMaterialConstruccion))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.ConstruccionMaterialConstruccion[ idConstruccionMaterialConstruccion=" + idConstruccionMaterialConstruccion + " ]";
    }
    
}
